Skip to content

fix(cli): stabilize built-in capability installation - #2601

Merged
wbxl2000 merged 3 commits into
mainfrom
fix/capability-sessionless
Aug 5, 2026
Merged

fix(cli): stabilize built-in capability installation#2601
wbxl2000 merged 3 commits into
mainfrom
fix/capability-sessionless

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue.

Problem

The built-in Kimi Computer Use and Kimi WebBridge rows in /plugins depended on an active session and mixed runtime readiness with installation state. This could hide the rows on a fresh v2 startup, report an installed plugin as unavailable, skip managed-plugin updates when another runtime layer was unhealthy, and leave legacy standalone WebBridge or Computer Use registrations competing with the managed plugin.

What changed

  • Resolve built-in capability detection and installation through the app-global SDK channel so /plugins works before the first session exists.
  • Keep Official marketplace rows focused on product descriptions and derive install / installed / update from plugin records and catalog versions; runtime setup details remain in logs.
  • Always refresh the managed plugin on an explicit built-in install or update while skipping runtime layers that are already healthy.
  • Back up legacy standalone WebBridge skills after the managed plugin is refreshed.
  • Remove only the exact legacy Computer Use MCP registration, preserve custom entries, abort migration if mcp.json changes during setup, and keep connected MCP frontends alive during app replacement.
  • Update the built-in marketplace metadata, bilingual plugin documentation, focused tests, and changeset.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

The lazy-session refactor left capability calls going through
requireSession(), so on a session-less v2 startup /plugins reported the
capabilities unavailable and hid the built-in rows behind the promo.
Like plugin management, capability readiness and installs are app-global
on the v2 engine: the node-sdk harness gains a capability facade over
the global channel, and the TUI resolves session-or-harness for every
capability call.
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 390a4f5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/kimi-code Patch
@moonshot-ai/kimi-code-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@390a4f5
npx https://pkg.pr.new/@moonshot-ai/kimi-code@390a4f5

commit: 390a4f5

dev.mjs always points KIMI_CODE_PLUGIN_MARKETPLACE_URL at its own
repo-serving server, which the override gate mistook for a user-configured
marketplace and suppressed the built-in capability rows in every dev run.
The dev server now marks itself, and the gate treats that marked URL as
the default catalog while still honoring real overrides (slash-command
source, user-set env, KIMI_CODE_DEV_MARKETPLACE_URL).
@wbxl2000 wbxl2000 changed the title fix(cli): show built-in capabilities before the first session exists fix(cli): stabilize built-in capability installation Aug 5, 2026
@wbxl2000

wbxl2000 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@wbxl2000
wbxl2000 merged commit 75fe068 into main Aug 5, 2026
15 checks passed
@wbxl2000
wbxl2000 deleted the fix/capability-sessionless branch August 5, 2026 06:55
@github-actions github-actions Bot mentioned this pull request Aug 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 390a4f5891

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +110 to +111
const knownKeys = new Set(['args', 'command']);
if (Object.keys(legacy).some((key) => !knownKeys.has(key))) return undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow persisted stdio keys in CU migration

mcp.json entries created through the existing global MCP CRUD path are persisted after schema parsing, so an otherwise exact stdio kimi-cu registration can legitimately include schema-owned fields such as transport: "stdio" (and an explicit enabled: true) in addition to this command/args. With this closed key set, those legacy registrations are treated as customized and removeLegacyMcpRegistration leaves them in place, so installing the managed capability can still leave the duplicate standalone MCP server active. Route this through the MCP config access layer or allow schema-default fields while still rejecting real customizations.

AGENTS.md reference: packages/agent-core-v2/AGENTS.md:L49-L58

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant